<template>
  <div id="modsort" class="menu-set">
    <fieldset class="layui-elem-field layui-field-title">
      <legend>模块排序</legend>
      <div class="layui-field-box">
        <draggable :list="moddata" element="ul" v-on:end="submit" :options="{animation: 300}">
          <transition-group tag="ul" name="list-complete">
            <li class="list-complete-item" v-for="(item,index) in moddata" :key="index" v-if="item.id=='Sponsor'||!(item.loadType=='BasicModule'&&pageconfig[pageconfig.theme].layout=='one')">
              {{item.config.title}}
              <!-- <a href="javascript:;" v-on:click="leftdel(index)">删除</a> -->
            </li>
          </transition-group>
        </draggable>
      </div>
    </fieldset>
  </div>
</template>

<script>
  import draggable from 'vuedraggable'

  export default {
    props: ["moddata", "pageconfig"],
    methods: {
      submit: function () {
        this.$emit("setdone", 1)
      }
    },
    components: {
      draggable,
    }
  }
</script>

<style>

</style>